﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Wijmo.master" AutoEventWireup="true" 
	CodeBehind="DataBinding.aspx.cs" Inherits="C1BarChart_DataBinding" %>
<%@ Register Assembly="C1.Web.Wijmo.Controls.3" namespace="C1.Web.Wijmo.Controls.C1Chart" tagPrefix="wijmo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server">
	<script type="text/javascript">
		function hintContent() {
			return this.data.label + '\n' + this.y + '';
		}
	</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
	<wijmo:C1BarChart ID="C1BarChart1" runat="server" DataSourceID="AccessDataSource1" Height="475" Width = "756">
		<Hint>
			<Content Function="hintContent" />
		</Hint>
		<Header Text="销量"></Header>
		<SeriesStyles>
			<wijmo:ChartStyle Stroke="#7fc73c" Opacity="0.8">
				<Fill Color="#8ede43"></Fill>
			</wijmo:ChartStyle>
		</SeriesStyles>
		<SeriesHoverStyles>
			<wijmo:ChartStyle StrokeWidth="1.5" Opacity="1" />
		</SeriesHoverStyles>
		<DataBindings>
			<wijmo:C1ChartBinding XField="CategoryName" XFieldType="String" YField="Sales" YFieldType="Number" />
		</DataBindings>
	</wijmo:C1BarChart>
	
	<asp:AccessDataSource ID="AccessDataSource1" runat="server" 
		DataFile="~/App_Data/C1NWind.mdb" 
		SelectCommand="select CategoryName, sum(ProductSales) as Sales from (SELECT DISTINCTROW Categories.CategoryName as CategoryName, Products.ProductName, Sum([Order Details Extended].ExtendedPrice) AS ProductSales
FROM Categories INNER JOIN (Products INNER JOIN (Orders INNER JOIN [Order Details Extended] ON Orders.OrderID = [Order Details Extended].OrderID) ON Products.ProductID = [Order Details Extended].ProductID) ON Categories.CategoryID = Products.CategoryID
WHERE (((Orders.OrderDate) Between #1/1/95# And #12/31/95#))
GROUP BY Categories.CategoryID, Categories.CategoryName, Products.ProductName
ORDER BY Products.ProductName) group by CategoryName;">
	</asp:AccessDataSource>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Description" Runat="Server">
	<p>The <strong>C1BarChart </strong>支持从服务器端的数据源绑定数据。</p><br/>
	<p>
		数据绑定可以设置<b>DataSourceID</b> 或者 <b>DataSource</b> 和 <b>DataBindings</b>.
		以下属性用来在特定的数据领域绑定 X， Y 值：</p>
	<ul>
		<li><strong>DataSourceID </strong>- 位于App_Data/C1NWind.mdb的特定数据源</li>
		<li><strong>DataBindings </strong>- 指定一系列绑定</li>
		<li><strong>C1ChartBinding.XField </strong>- 把X绑定到指定的字段</li>
		<li><strong>C1ChartBinding.XFieldType</strong> - 把X型 绑定到指定的字段</li>
		<li><strong>C1ChartBinding.YField </strong>- 把Y绑定到指定的字段</li>
		<li><strong>C1ChartBinding.YFieldType </strong>- 把Y型 绑定到指定的字段</li>
	</ul>
	<p>数据绑定是一个包含 <strong>C1ChartBinding</strong> 实例的集合。  
		<strong>C1ChartBinding </strong>包含以下属性:</p>
	<ul>
		<li><strong>DataMember </strong>- 当数据源包含至少一个列表时，指定数据列表的名称。</li>
		<li><strong>HintField </strong>- 在特定的领域绑定暗示内容。</li>
	</ul>
	<p>如果设置了 <strong>HintField </strong>属性，鼠标移动到字符串时，会显示和字符串具有相同索引值的暗含值。</p>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ControlOptions" Runat="Server">
</asp:Content>

